package com.example.config;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

/**
 * @Create by Intellij IDEA
 * @Author: songXuSheng
 * @Date: 2021/9/9 15:37
 */
public class WebConfig {
    public static Client getClient(){
        JaxWsDynamicClientFactory proxyFactoryBean =  JaxWsDynamicClientFactory.newInstance();
        Client client = proxyFactoryBean.createClient("http://localhost:7006/wbs/user-server?wsdl");
        // 需要密码的情况需要加上用户名和密码
        // client.getOutInterceptors().add(new ClientLoginInterceptor(USER_NAME,PASS_WORD));
        return client;
    }
}
